package cn.tedu.drs.rider.controller;

import cn.tedu.drs.base.response.JsonResult;
import cn.tedu.drs.rider.pojo.dto.RiderRegParam;
import cn.tedu.drs.rider.pojo.entity.Rider;
import cn.tedu.drs.rider.service.RiderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/v1/rider")
public class riderController {
    @Autowired
    private RiderService riderService;
    @PostMapping("reg")
    public JsonResult reg(@RequestBody RiderRegParam riderRegParam){
        log.debug("注册参数 ：{}", riderRegParam);
        riderService.saveRider(riderRegParam);
        return JsonResult.ok();
    }

}
